import logging

logger=logging.getLogger('cnodeapi')
logger.setLevel(logging.DEBUG)

format=logging.Formatter('[%(asctime)s] [%(levelname)s] [%(funcName)s] %(message)s')

fl=logging.FileHandler(filename='demo.log',mode='a')
fl.setLevel(logging.DEBUG)
fl.setFormatter(format)

sl=logging.StreamHandler()
sl.setFormatter(format)

logger.addHandler(fl)
logger.addHandler(sl)

logger.debug('niubi')